<!DOCTYPE html>
<html lang="en">

<head>
    <title>电子竞技</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />

    <link rel="stylesheet" href="../../css/public.css">
    <style>        
        .register_bg {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            background: url('../images/reg/bg.png') center no-repeat;
            background-size: 100%;
            z-index: 1;
        }
        .home_zhangdui_nav {
            padding-left: 15%;
            overflow: hidden;
            background: #021349 url('../../images/reg/back.png') 10px center no-repeat;
            background-size: .7rem;
        }

        .history {
            margin-top: 5px;
            float: right;
            height: 45px;
            width: 45px;
            margin-right: 5px;
            color: #FAE7A5;
            background: url(../../images/home/icon_record.png)center no-repeat;
            background-size: .6rem;
        }

        .lineHead {
            height: 60px;
            margin-top: 50px;
            background: #1B1D5D;
            display: flex;
            line-height: 60px;
            padding: 0 3%;
        }

        .lineHead div {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .online {
            flex: 6;
            /* text-align: center; */
            font-size: .5rem;
            color: #FFCD29;
        }

        .opening,
        .contrast {
            flex: 5;
            color: #BFC1F2;
            font-size: .3rem;
        }

        .opening {
            font-size: .35rem;
        }

        .contrast {
            line-height: 20px;
            padding-top: 10px;
        }
        .k {
            color: #FFCD29;
        }

        .footer {
            position: fixed;
            display: flex;
            bottom: 0;
            width: 100%;
            height: 50px;
            text-align: center;
        }

        .footer img {
            width: .55rem;
            display: block;
            margin: auto;
            margin-top: 7px;
        }

        .footer>div {
            flex: 1;
        }

        .size {
            background: #8BC52D;
        }

        .upDown {
            background: #1EA1F3;
        }
        .firstsd {
            background: #F5BC31;
        }

        .modal {
            background: rgba(000, 000, 000, 0.5);
            position: fixed;
            width: 100%;
            height: 100%;
            z-index: 9999;
            color: #BFC1F2;
            display: none;
        }
        .continueModal{
            display: none;
        }
        .modal table,.continueModal table {
            width: 100%;
            text-align: center;
            font-size: .4rem;
            border-bottom: 1px solid #2A2B6B;
        }

        .upDown-modal {
            background: #1B1D68;
            /* height: 70%; */
            width: 85%;
            margin: 10% auto;
            padding-bottom: 5px;

            border-radius: 5px;
        }

        .title {
            color: #7E85C2;
        }

        .contain {
            color: #BFC1F2;
            font-size: .4rem;
        }
        .order,.dueTime {
            text-align: center;
            height: 40px;
            line-height: 40px;
            font-size: .45rem;
            padding: 0 10px;
        }

        .continueTitle {
            height: 40px;
            line-height: 40px;
            font-size: .45rem;
            padding: 0 10px;
            border-bottom: 1px solid #2A2B6B;
            
        }

        .close,
        .close1 {
            float: right;
            height: 40px;
            line-height: 40px;
        }

        .order img,
        .continueTitle img {
            width: .45rem;
            vertical-align: middle;
        }
        .time2>div {
            margin: auto;
        }

        .time3>div {
            margin-left: 8%;
        }

        .betMoney {
            height: 50px;
            background: #111351;
            padding: 0 10px;
        }

        input::-webkit-input-placeholder,
        textarea::-webkit-input-placeholder {
            color: #454898;
        }

        .betMoney .betIn {
            text-align: center;
            margin-right: 2%;
            height: 37px;
            width: 22.2%;
            color: #7E85C2;
            background: #1B1D68;
            border: 1px solid #454898;
            border-radius: 5px;
            font-size: .4rem;
            vertical-align: inherit;
        }

        .balance {
            height: 40px;
            font-size: .4rem;
            padding: 0 10px;
            line-height: 40px;
            color: #7E85C2;
        }

        .yue {
            color: #BFC1F2;
            margin-right: 20%;
        }

        .betYue {
            color: #1DA8FF;
        }

        .confirm ,.conBtn{
            display: block;
            width: 70%;
            height: 45px;
            border: 0;
            color: #fff;
            background: #FFB400;
            font-size: .5rem;
            margin: 10px auto;
            border-radius: 5px;
        }


        .betMoney .betActive {
            color: #F5BC31;
            border: 1px solid #F5BC31;
        }

        .continueModal {
            background: rgba(000, 000, 000, 0.5);
            position: fixed;
            width: 100%;
            height: 100%;
            z-index: 9999;
            color: #BFC1F2;
        }

        .continue {
            height: 200px;
        background: #1B1D68;
        color: #BFC1F2;
        border-radius: 5px;
        width: 80%;
        margin: auto;
        margin-top: 40%;
        }
        .notice{
            text-align: center;
            font-size: .4rem;
            margin-top: 20px;
        }
    </style>
    <style>
        .graph{text-align: center;overflow: hidden;}
        .graph .title{
            margin-top: 1.22rem;
            margin-bottom: 0.22rem;
            font-size: 0.56rem;
            color: #FFCD29;
        }
        .remind{
            font-size: 0.31rem;
            color: #BFC1F2;
        }
        #barGraph{
            display: flex;
            height: 7.777778rem;
            margin-top: 0.555556rem;
            overflow-x: scroll;
        }
        .bar-item{
            display: flex;
            flex-direction: column-reverse;
            align-items: center;
            width: 1rem;
            height: 100%;
            margin-left: 0.8rem;
        }
        .bar-item .num{
            font-size: 0.33rem;
        }
        .bar-item .mid{
            width: .44rem;
            border-radius: 2px;
        }
        .bar-item .time{
            font-size: 0.3rem;
            color: #7E85C2;
        }
        #barGraph .bar-item:first-child{
            margin-left: 0.8rem;
        }
        #barGraph .bar-item:last-child{
            margin-right: 0.63rem;
        }
        #barGraph .bar-item:nth-child(1n) .num{
            color: #1FA8FE
        }
        #barGraph .bar-item:nth-child(1n) .mid{
            background: #1FA8FE;
        }
        #barGraph .bar-item:nth-child(2n) .num{
            color: #F5BC31
        }
        #barGraph .bar-item:nth-child(2n) .mid{
            background: #F5BC31;
        }

        /*下单弹窗*/
        .modal .award-period{
            margin: 0.416667rem;
            padding: 0.388889rem 0.444444rem;
            font-size: 0.388889rem;
            color: #D0D2F7;
            border: 0.027778rem solid #454898;
            border-radius: 0.055556rem;
            background: #1B1D68;
        }
        /*特码*/
        .upDown1 .special-code{
             margin: 0.416667rem;
            color: #BFC1F2;
             border: 0.027778rem solid #454898;
            border-radius: 0.055556rem;
            background: #1B1D68;    
        }
        .upDown1 .special-code .title{
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 0.222222rem;
            font-size: 0.388889rem;
        }
        .upDown1 .special-code .title img{
            width: 0.361111rem;
            height: 0.416667rem;
            margin-right: 0.25rem;
        }
        .upDown1 .special-code .num{
            display: flex;
            flex-wrap: wrap;
        }
        .upDown1 .special-code .num-item{
            width: 0.7778rem;
            height: 0.7778rem;
            line-height: 0.7778rem;
            margin: 0.194444rem 0.356667rem;
             color: #BFC1F2;
             border: 0.027778rem solid #454898;
            border-radius: 0.055556rem;
            background: #1B1D68;
            text-align: center;
        }
        .upDown1 .special-code .num-item.on{
            color: #FFCD29;
            border-color: #FFCD29;
        }
        /*大小*/
        .bigLittle .big-small, .singleDable .single-double{
            display: flex;
            justify-content: space-between;
            margin: 0 0.416667rem;
        }
        .bigLittle .big-small .item, .singleDable .single-double .item{
            width: 45%;
            height: 1.444444rem;
            border: 0.027778rem solid #454898;
            border-radius: 0.055556rem;
            color: #BFC1F2;
        }
        .bigLittle .big-small .item.on, .singleDable .single-double .item.on{
            border-color: #FFCD29;
        }
        .bigLittle .big-small .item .num, .singleDable .single-double .item .num{
            display: flex;
            align-items: center;
            justify-content: space-around;
        }
        .bigLittle .big-small .item.on .top, .singleDable .single-double .item.on .top{
            color: #FFCD29;
         }
         .bigLittle .big-small .item .top, .singleDable .single-double .item .top{
             margin: 0.16rem 0.166667rem 0;
            text-align: center;
         }
         /*单双*/
         .singleDable{}
    </style>
</head>

<body>

    <div class="register_bg">
        <div class="home_zhangdui_nav">
            <span class="goBack"></span>
            王者荣耀
            <a href="./tradingRecord.html">
                <span class="history"></span>
            </a>
        </div>

        <div class="lineHead">
            <div class="online">0</div>
            <div class="opening">开盘：3215454</div>
            <div class="contrast">
                <div class="max">最高：96485762</div>
                <div class="min">最低：1642331</div>
            </div>
        </div>
        
        <div class="graph">
            <div class="title">当日开奖号码</div>
            <p class="remind">（柱状图上的数值表示开奖号码的后三位）</p>
            <div id="barGraph">
               <!--  <div class="bar-item">
                   <p class="time">G10期</p>
                   <div class="mid" style="height: 70%;"></div>
                   <p class="num">240</p>
               </div> -->
            </div>
        </div>
        <div class="footer">
            <div class="upDown">
                <img src="../../images/eSports/dzjj_icon_special@2x.png" alt="">买特码</div>
            <div class="size">
                <img src="../../images/eSports/icon_big.png" alt="">买大小</div>
            <div class="firstsd">
                <img src="../../images/eSports/icon_dabble.png" alt="">买单双</div>

        </div>
    </div>
    <!-- 买特码 -->
    <div class="modal upDown1" style="display: none;">
        <div class="upDown-modal">
            <div class="order">订单确认
                <div class="close">
                    <img src="../../images/eSports/icon_close.png" alt="">
                </div>
            </div>
            <div style="background: #111351;overflow: hidden;">
                <!-- 下单通用开奖期号 -->
                <div class="award-period">开奖期号：<span style="color: #FFCD29;">第16期</span></div>
                <!-- 特码选择 -->
                <div class="special-code">
                    <div class="title">
                        <img src="../../images/eSports/mtm_icon_especially@2x.png"> 特码
                    </div>
                    <div class="num">
                        <div class="num-item">1</div>
                        <div class="num-item">2</div>
                        <div class="num-item on">3</div>
                        <div class="num-item">4</div>
                        <div class="num-item" style="margin-right: 0;">5</div>
                        <div class="num-item">6</div>
                        <div class="num-item">7</div>
                        <div class="num-item">8</div>
                        <div class="num-item">9</div>
                        <div class="num-item" style="margin-right: 0;">0</div>
                    </div>
                </div>
                <!-- 下单通用金额 -->
                <div style="color: #7E85C2;margin:10px;">投注金额</div>
                <div class="betMoney">
                    <button class="betIn betActive" type="text">￥2000</button>
                    <button class="betIn" type="text">￥3000</button>
                    <button class="betIn" type="text">￥5000</button>
                    <input class="other betIn" style="margin-right:0;height:35px" type="number" placeholder="其他金额">
                </div>
            </div>
            <!-- 下单通用底部 -->
            <div class="balance">
                余额:￥
                <span class="yue">0</span> 下单金额:
                <span class="betYue">0</span>
            </div>
            <div>
                <table>
                    <tr class="title">
                        <td>名称</td>
                        <td>类型</td>
                        <td >现有</td>
                    </tr>
                    <tr class="contain">
                        <td>王者荣耀</td>
                        <td class='buyType'>特码</td>
                        <td class="onlineNow">23132546</td>
                    </tr>
                </table>
            </div>
            <button class="confirm">确认下单</button>
        </div>
    </div>
    <!-- 买大小 -->
    <div class="modal bigLittle" style="display: none;" style="position:absolute;padding-bottom: 10%;" >
        <div class="upDown-modal" >
            <div class="order">订单确认
                <div class="close">
                    <img src="../../images/eSports/icon_close.png" alt="">
                </div>
            </div>
            <!-- 下单通用开奖期号 -->
            <div class="award-period">开奖期号：<span style="color: #FFCD29;">第16期</span></div>
            <!-- 大小 -->
            <div style="color: #7E85C2;margin:10px;">类型</div>
            <div class="big-small">
                <div class="big item on">
                    <div class="top">
                        <span style="font-size: 0.444444rem;">大</span>
                        <span class="fdOdds">（赔率:--）</span>
                    </div>
                    <div class="num">
                        <span>5</span>
                        <span>6</span>
                        <span>7</span>
                        <span>8</span>
                        <span>9</span>
                    </div>
                </div>
                <div class="small item">
                    <div class="top">
                        <span style="font-size: 0.444444rem;">小</span>
                        <span class="fdOdds">（赔率:--）</span>
                    </div>
                    <div class="num">
                        <span>0</span>
                        <span>1</span>
                        <span>2</span>
                        <span>3</span>
                        <span>4</span>
                    </div>
                </div>
            </div>
            <!-- 下单通用金额 -->
            <div style="color: #7E85C2;margin:10px;">投注金额</div>
            <div class="betMoney">
                <button class="betIn betActive" type="text">￥2000</button>
                <button class="betIn" type="text">￥3000</button>
                <button class="betIn" type="text">￥5000</button>
                <input class="other betIn" style="margin-right:0;height:35px" type="number" placeholder="其他金额">
            </div>
            <!-- 下单通用底部 -->
            <div class="balance">
                余额:￥
                <span class="yue">0</span> 下单金额:
                <span class="betYue">0</span>
            </div>
            <div>
                <table>
                    <tr class="title">
                        <td>名称</td>
                        <td>类型</td>
                        <td>现有</td>
                    </tr>
                    <tr class="contain">
                        <td>王者荣耀</td>
                        <td class='buyType'>大小</td>
                        <td class="onlineNow">23132546</td>
                    </tr>
                </table>
            </div>
            <button class="confirm">确认下单</button>
        </div>
    </div>
    <!-- 买单双 -->
    <div class="modal singleDable" style="display: none;">
        <div class="upDown-modal">
            <div class="order">订单确认
                <div class="close">
                    <img src="../../images/eSports/icon_close.png" alt="">
                </div>
            </div>
             <!-- 下单通用开奖期号 -->
            <div class="award-period">购买期号：<span style="color: #FFCD29;">第16期</span></div>
            <!-- 单双 -->
            <div style="color: #7E85C2;margin:10px;">类型</div>
            <div class="single-double">
                <div class="single item on">
                    <div class="top">
                        <span style="font-size: 0.444444rem;">单</span>
                        <span class="fdOdds">（赔率:--）</span>
                    </div>
                    <div class="num">
                        <span>1</span>
                        <span>3</span>
                        <span>5</span>
                        <span>7</span>
                        <span>9</span>
                    </div>
                </div>
                <div class="double item">
                    <div class="top">
                        <span style="font-size: 0.444444rem;">双</span>
                        <span class="fdOdds">（赔率:--）</span>
                    </div>
                    <div class="num">
                        <span>0</span>
                        <span>2</span>
                        <span>4</span>
                        <span>6</span>
                        <span>8</span>
                    </div>
                </div>
            </div>
            <!-- 下单通用金额 -->
            <div style="color: #7E85C2;margin:10px;">投注金额</div>
            <div class="betMoney">
                <button class="betIn betActive" type="text">￥2000</button>
                <button class="betIn" type="text">￥3000</button>
                <button class="betIn" type="text">￥5000</button>
                <input class="other betIn" style="margin-right:0;height:35px" type="number" placeholder="其他金额">
            </div>
            <div class="balance">
                余额:￥
                <span class="yue">0</span> 下单金额:
                <span class="betYue">0</span>
            </div>
            <div>
                <table>
                    <tr class="title">
                        <td>名称</td>
                        <td>类型</td>
                        <td >现有</td>
                    </tr>
                    <tr class="contain">
                        <td>王者荣耀</td>
                        <td class='buyType'></td>
                        <td  class="onlineNow"></td>
                    </tr>
                </table>
            </div>
            <button class="confirm">确认下单</button>
        </div>
    </div>

    <div class="continueModal">
        <div class="continue">
            <div class="continueTitle"><span>王者荣耀</span>
                <div class="close1">
                    <img src="../../images/eSports/icon_close.png" alt="">
                </div>
            </div>
            <!-- <div class="timeContain"><span class="continuTime">0</span> s</div> -->
            <div class="notice">
                <p class="successMsg"></p> 
                <p>请点击继续下单</p>
            </div>
            <button class="conBtn">继续下单</button>
        </div>
    </div>
    <script src="../../js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../../js/bootstrap-dropdown.js"></script>
    <script type="text/javascript" src="../../js/jquery.scrollUp.min.js"></script>
    <script src="../../js/public.js"></script>
    <script>
        $(function () {

            // 初始化wbs，用来更新开期数
            function initWebsocket() {
                let websocket, barGraph = $('#barGraph')
                if ('WebSocket' in window) {
                    websocket = new WebSocket(`ws://${urlHeadNoHttp}/serverGameNumber?userId=${userId}`);
                } else {
                    websocket = new SockJS(
                        `${urlHead}/serverGameNumber?userId=${userId}`
                    );
                }
                websocket.onopen = function (event) {
                    console.log('onopen:', event);
                };
                websocket.onmessage = function (event) {
                    console.log('onmessage:', event);
                    let item = JSON.parse(event.data);
                    $('.online').text(item.fdPeriodResult);
                    let barGraphItme = `<div class="bar-item">
                        <p class="time">${item.fdPreiodIndex}</p>
                        <div class="mid" style="height: ${(`${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10 > 8 ? `${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10-8 : `${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10)}%;"></div>
                        <p class="num">${`${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)}</p>
                    </div>`
                    barGraph.append(barGraphItme)
                    barGraph[0].scrollLeft = barGraph[0].scrollWidth;
                }
                websocket.onclose = function (event) {
                    websocket.close();
                }
            }
                    
               
            let fdGameName,
                downOdds,
                upOdds,
                singleDableOdds,
                temaOdds,
                fdType,
                userId,
                nextFdPreiodIndex,
                resultArr,
                isSecondClick = false

            // 获取个人信息
            $.post(userInfoUrl, (res) => {
                console.log('获取个人信息', res)
                $('.yue').text(res.obj.fdOver)
                userId = res.obj.fdId
                localStorage.setItem("userId", userId);
                initWebsocket();
            })

            // 获取陪注接口
            let fdOddsArr = []
            $.post(gamingOdds, (res) => {
                console.log('获取陪注接口:', res)
                fdOddsArr = res.obj
                let bigLittleFdOdds = $('.bigLittle .fdOdds'), singleDableFdOdds = $('.singleDable .fdOdds')
                fdOddsArr.forEach(function(item, idx){
                    if(item.fdType == 0){ //大小
                        bigLittleFdOdds.text(`（赔率:${item.fdOdds}）`)
                    }
                    if(item.fdType == 1){ //单双
                        singleDableFdOdds.text(`（赔率:${item.fdOdds}）`)
                    }
                })
            })

            // 获取当日竞猜游戏数据信息
            $.post(getCurrentDateGameNumberInfos, (res)=>{
                console.log('获取当日竞猜游戏数据信息:', res)
                let online = $('.lineHead .online'),
                    opening = $('.lineHead .opening'),
                    contrastMax = $('.lineHead .contrast .max'),
                    contrastMin = $('.lineHead .contrast .min'),
                    barGraph = $('#barGraph')
                resultArr = res.result, rulues = res.rulues, barGraphHtml = ``
                resultArr.find(function(val, idx){
                    if(val.fdPreiodIndex == 1){
                        opening.html(`开盘：${val.fdPeriodResult}`);
                        return true;
                    }
                })
                online.html(resultArr[resultArr.length-1].fdPeriodResult);
                contrastMax.html(`最高：${rulues.fdNumberMin}`);
                contrastMin.html(`最低：${rulues.fdNumberMax}`);
                resultArr.forEach(function(item, idx){
                    let barItem = `<div class="bar-item">
                        <p class="time">${item.fdPreiodIndex}</p>
                        <div class="mid" style="height: ${(`${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10 > 8 ? `${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10-8 : `${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)/10)}%;"></div>
                        <p class="num">${`${item.fdPeriodResult}`.substring(`${item.fdPeriodResult}`.length-3)}</p>
                    </div>`;
                    barGraphHtml += barItem
                })
                barGraph.append(barGraphHtml);
                 // 购买公共数据
                 nextFdPreiodIndex = resultArr[resultArr.length-1].fdPreiodIndex + 1
                let awardPeriod = $('.award-period')
                awardPeriod.find('span').html(`第${resultArr[resultArr.length-1].fdPreiodIndex + 1}期`)
                let onlineNow = $('.onlineNow')
                onlineNow.html(resultArr[resultArr.length-1].fdPeriodResult)
            });

            // 特码
            $('.upDown').click(function(){
                $('.upDown1').fadeIn('fast')
                fdType = 2
            })
            let specialCodeNum = $('.special-code .num-item')
            specialCodeNum.click(function(event) {
                specialCodeNum.removeClass('on')
                $(this).addClass('on')
            });
             // 特码的投注金额
            $('.upDown1 .betYue').text($('.upDown1 .betIn.betActive').text())
            $('.upDown1 .betIn').click(function () {
                $('.upDown1 .other').val('')
                $('.upDown1 .betIn').removeClass('betActive')
                $(this).addClass('betActive')
                $('.upDown1 .betYue').text($('.upDown1 .betIn.betActive').text())
            })

            // 大小
            $('.size').click(function(){
                $('.bigLittle').fadeIn('fast')
                fdType = 0
            })
            let bigSmall = $('.bigLittle .big-small')
            bigSmall.find('.item').click(function(event) {
                bigSmall.find('.item').removeClass('on')
                $(this).addClass('on')
            });
            // 大小的投注金额
            $('.bigLittle .betYue').text($('.bigLittle .betIn.betActive').text())
            $('.bigLittle .betIn').click(function () {
                $('.bigLittle .other').val('')
                $('.bigLittle .betIn').removeClass('betActive')
                $(this).addClass('betActive')
                $('.bigLittle .betYue').text($('.bigLittle .betIn.betActive').text())
            })

            // 单双
            $('.firstsd').click(function () {
                $('.singleDable').fadeIn('fast')
                fdType = 1
            })
            let singleDouble = $('.singleDable .single-double')
            singleDouble.find('.item').click(function(event) {
                singleDouble.find('.item').removeClass('on')
                $(this).addClass('on')
            });
             // 大小的投注金额
            $('.singleDable .betYue').text($('.singleDable .betIn.betActive').text())
            $('.singleDable .betIn').click(function () {
                $('.singleDable .other').val('')
                $('.singleDable .betIn').removeClass('betActive')
                $(this).addClass('betActive')
                $('.singleDable .betYue').text($('.singleDable .betIn.betActive').text())
            })

           

            // 确认下单
            $('.confirm').click(function () {
                if(isSecondClick){
                    alert('正在下单，请稍后继续下单')
                    return;
                }
                isSecondClick = true
                let fdMoney, fdNumber, fdBettingTypeId
                // nextFdPreiodIndex
                fdOddsArr.find(function(item, idx){
                    if(item.fdType == fdType){
                        fdBettingTypeId = item.fdId
                        console.log('fdBettingTypeId:', fdBettingTypeId)
                    }
                })
                switch(fdType) {
                    case 0: // 大小
                        fdMoney = $('.bigLittle .betYue').text().substring(1)
                        if($('.bigLittle .big-small .item.on').hasClass('big')){
                            fdNumber = 98765
                        }
                        if($('.bigLittle .big-small .item.on').hasClass('small')){
                            fdNumber = 43210
                        }
                        if(!fdMoney){
                            alert('请输入金额')
                            return;
                        }
                        break;
                     case 1: // 单双
                        fdMoney = $('.singleDable .betYue').text().substring(1)
                        if($('.singleDable .single-double .item.on').hasClass('single')){
                            fdNumber = 97531
                        }
                        if($('.singleDable .single-double .item.on').hasClass('double')){
                            fdNumber = 86420
                        }
                        if(!fdMoney){
                            alert('请输入金额')
                            return;
                        }
                        break;
                     case 2:  // 特码
                        fdMoney = $('.upDown1 .betYue').text().substring(1)
                        fdNumber = $('.upDown1 .special-code .num-item.on').text()
                        if(!fdMoney){
                            alert('请输入金额')
                            return;
                        }
                        break;
                }
                console.log('下单校验成功：',userId, fdMoney, fdNumber, fdBettingTypeId,nextFdPreiodIndex)
                $.post( eSportsBuyNumber, {
                    userId: userId, 
                    fdMoney: fdMoney, 
                    fdNumber: fdNumber,
                    fdBettingTypeId: fdBettingTypeId,
                    fdPreiodIndex: nextFdPreiodIndex
                },res=>{
                    console.log('下单成功返回:', res)
                    alert(res.content)
                    isSecondClick = false
                    $('.singleDable').fadeOut('fast')
                    $('.bigLittle').fadeOut('fast')
                    $('.upDown1').fadeOut('fast')
                })
            })
           
            $('.close').click(function () {
                $('.singleDable').fadeOut('fast')
                $('.bigLittle').fadeOut('fast')
                $('.upDown1').fadeOut('fast')
            })


            // 选择投注类型
            $('.buy').click(function () {
            })

            // 继续下单关闭
            $('.close1 img').click(function(){
                $('.continueModal').fadeOut('fast')
            })

            // 下单其他金额
            $('.upDown1 .other').bind('input propertychange', function () {
                $('.upDown1 .betYue').text(`￥${$('.upDown1 .other').val()}`)
            })
            $('.bigLittle .other').bind('input propertychange', function () {
                $('.bigLittle .betYue').text(`￥${$('.bigLittle .other').val()}`)
            })
            $('.singleDable .other').bind('input propertychange', function () {
                $('.singleDable .betYue').text(`￥${$('.singleDable .other').val()}`)
            })

            // 继续下单按钮
            $('.conBtn').click(function(){
                $('.continueModal').fadeOut('fast')
                $('.modal').fadeOut('fast')
            })
        })
    </script>
</body>

</html>